package com.itheima.homework;

import java.util.Random;

public class Demo6 {
    public static void main(String[] args) {
        Random r = new Random();

        String allUpCode = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
        String allLower = allUpCode.toLowerCase();
        String num = "1234567890";

        StringBuilder sb = new StringBuilder();
        StringBuilder y = new StringBuilder();
        sb.append(allLower);
        sb.append(allUpCode);
        sb.append(num);

        for (int i = 0; i < 4; i++) {
            int Index = r.nextInt(sb.length());
            char ch = sb.charAt(Index);
            y.append(ch);

        }
        System.out.println("本次验证码是:" + y);


    }
}
